require("../../@babel/runtime/helpers/Arrayincludes");
var e = require("../../store/index"),
  t = ["/pages/call-record/index"];
$.router.beforeEach((function (n, r, o, u) {
  var i = $.router.useRouter();
  if (i.setValue({
      to: n,
      from: r,
      next: o,
      params: u
    }), !(0, e.getState)().storage.userInfo.token && t.includes(n)) {
    i.setValue({
      interceptNext: function () {
        o(), i.setValue({
          interceptNext: function () {
            return $.router.back()
          }
        })
      }
    }), $.router.push("/subpackage/login/auth/index")
  } else {
    if ($.isIos && "/subpackage/personal/member/index" === n) {
      var a = (0, e.getState)().global.customerServicePhone,
        l = ["开通会员请前往", {
          text: "工程找机械",
          color: "#ff9802"
        }, "公众号或拨打客服电话:", {
          text: a,
          color: "#ff9802"
        }, "联系客服人员开通会员"];
      return $.jxAlert({
        mode: "confirm",
        content: l,
        cancelText: "拨打客服电话",
        confirmText: "复制公众号名称"
      }).then((function () {
        wx.setClipboardData({
          data: "工程找机械",
          success: function () {
            wx.showToast({
              title: "复制成功",
              icon: "none"
            })
          }
        })
      }), (function (e) {
        "cancel" == e && wx.makePhoneCall({
          phoneNumber: a
        })
      })), !0
    }
    if (null != n && n.includes("pages/common/view")) {
      var s = function (e) {
        for (var t = null == e ? void 0 : e.split("?")[1], n = null == t ? void 0 : t.split("&"), r = {}, o = 0; o < (null == n ? void 0 : n.length); o++) {
          var u = n[o].split("=");
          null != u && u[0] && (r[u[0]] = u[1])
        }
        return r
      }(n);
      $.router.push("/subpackage/common/details/index", {
        uuid: s.id,
        mode: s.mode
      })
    } else o()
  }
}));